home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / kill-the-dragons.swf / scripts / frame_482 / DoAction.as
Encoding:
Text File  |  2011-12-21  |  523 b   |  25 lines

  1. onEnterFrame = function()
  2. {
  3.    if(plyWithin == true && ply.thisEnergy > 0)
  4.    {
  5.       mouseX = _xmouse;
  6.       mouseY = _ymouse;
  7.    }
  8.    plyX = ply._x;
  9.    plyY = ply._y;
  10.    differenceX = mouseX - plyX;
  11.    differenceY = mouseY - plyY;
  12.    if(Math.abs(differenceX) > 1 && Math.abs(differenceY) > 1)
  13.    {
  14.       plyWalk = true;
  15.       ply._x += differenceX / plySpeed;
  16.       ply._y = ply._Y + differenceY / plySpeed;
  17.    }
  18.    else
  19.    {
  20.       plyWalk = false;
  21.    }
  22. };
  23. startAnim.gotoAndPlay("start");
  24. stop();
  25.